from interface.DistinGuishedGuest import DistinGuishedGuest
from untils.SendMethod import SendMethod


class GuestCase:
    def __init__(self):
        self.event = DistinGuishedGuest()

    def test_add_guest(self):
        body = {
            "eid": "11666887",
            "realname": "www66",
            "phone": "13956866454",
            "email": "23365@qq.com"
        }
        # 发送添加嘉宾请求
        result = self.event.add_guest(body)
        print(result)
        # 查看状态码
        status_code = result.get("status_code")
        # 断言状态码
        assert status_code == 200
        # 查看message
        message = result.get("body").get("message")
        # 断言状态码
        assert message == "add guest success"

    def test_get_guest(self):
        params = {
            "eid": "11666887",
            "phone": "13956866454"
        }
        # 发送查询嘉宾请求
        result = self.event.get_guest(params)
        print(result)
        # 查看状态码
        status_code = result.get("status_code")
        # 断言状态码
        assert status_code == 200
        # 查看message
        message = result.get("body").get("message")
        # 断言状态码
        assert message == "success"

    def test_user_sign(self):
        data = {
            "eid": "11666887",
            "phone": "13956866454"
        }
        # 发送签到请求
        result = self.event.get_guest(data)
        print(result)
        # 查看状态码
        status_code = result.get("status_code")
        # 断言状态码
        assert status_code == 200
        # 查看message
        message = result.get("body").get("message")
        # 断言状态码
        assert message == "success"



if __name__ == '__main__':
    # GuestCase().test_add_guest()
    # GuestCase().test_get_guest()
    GuestCase().test_user_sign()
